﻿using System.Collections.ObjectModel;
using System.Configuration;

namespace PSE.Framework.Communication.Configuration.Adapters
{
    /// <summary>
    /// Coleção de actions de adapters
    /// </summary>
    /// 
    public abstract class AdapterActionConfigurationCollection : CommunicationConfigurationElementCollection
    {
        public new AdapterActionConfiguration this[int index]
        {
            get
            {
                return base[index] as AdapterActionConfiguration;
            }
            set
            {
                base[index] = value;
            }
        }

        public new AdapterActionConfiguration this[string key]
        {
            get
            {
                return base[key] as AdapterActionConfiguration;
            }
            set
            {
                base[key] = value;
            }
        }
        
        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((AdapterActionConfiguration)element).Name;
        }
    }

}